<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Mocks::ErrorGenerator</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Mocks::ErrorGenerator</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/mocks/error_generator_rb.html">
                vendor/plugins/rspec/lib/spec/mocks/error_generator.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000260">new</a>&nbsp;&nbsp;
      <a href="#M000261">opts</a>&nbsp;&nbsp;
      <a href="#M000266">raise_block_failed_error</a>&nbsp;&nbsp;
      <a href="#M000264">raise_expectation_error</a>&nbsp;&nbsp;
      <a href="#M000267">raise_missing_block_error</a>&nbsp;&nbsp;
      <a href="#M000265">raise_out_of_order_error</a>&nbsp;&nbsp;
      <a href="#M000263">raise_unexpected_message_args_error</a>&nbsp;&nbsp;
      <a href="#M000262">raise_unexpected_message_error</a>&nbsp;&nbsp;
      <a href="#M000268">raise_wrong_arity_error</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">opts</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000260" class="method-detail">
        <a name="M000260"></a>

        <div class="method-heading">
          <a href="#M000260" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(target, name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000260-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000260-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 6</span>
6:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">name</span>)
7:         <span class="ruby-ivar">@target</span> = <span class="ruby-identifier">target</span>
8:         <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
9:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000261" class="method-detail">
        <a name="M000261"></a>

        <div class="method-heading">
          <a href="#M000261" class="method-signature">
          <span class="method-name">opts</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000261-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000261-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 11</span>
11:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">opts</span>
12:         <span class="ruby-ivar">@opts</span> <span class="ruby-operator">||=</span> {}
13:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000266" class="method-detail">
        <a name="M000266"></a>

        <div class="method-heading">
          <a href="#M000266" class="method-signature">
          <span class="method-name">raise_block_failed_error</span><span class="method-args">(sym, detail)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000266-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000266-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 33</span>
33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_block_failed_error</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">detail</span>)
34:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} received :#{sym} but passed block failed with: #{detail}&quot;</span>
35:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000264" class="method-detail">
        <a name="M000264"></a>

        <div class="method-heading">
          <a href="#M000264" class="method-signature">
          <span class="method-name">raise_expectation_error</span><span class="method-args">(sym, expected_received_count, actual_received_count, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000264-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000264-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 25</span>
25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_expectation_error</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">expected_received_count</span>, <span class="ruby-identifier">actual_received_count</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
26:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} expected :#{sym}#{arg_message(*args)} #{count_message(expected_received_count)}, but received it #{count_message(actual_received_count)}&quot;</span>
27:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000267" class="method-detail">
        <a name="M000267"></a>

        <div class="method-heading">
          <a href="#M000267" class="method-signature">
          <span class="method-name">raise_missing_block_error</span><span class="method-args">(args_to_yield)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000267-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000267-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 37</span>
37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_missing_block_error</span>(<span class="ruby-identifier">args_to_yield</span>)
38:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} asked to yield |#{arg_list(*args_to_yield)}| but no block was passed&quot;</span>
39:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000265" class="method-detail">
        <a name="M000265"></a>

        <div class="method-heading">
          <a href="#M000265" class="method-signature">
          <span class="method-name">raise_out_of_order_error</span><span class="method-args">(sym)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000265-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000265-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 29</span>
29:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_out_of_order_error</span>(<span class="ruby-identifier">sym</span>)
30:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} received :#{sym} out of order&quot;</span>
31:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000263" class="method-detail">
        <a name="M000263"></a>

        <div class="method-heading">
          <a href="#M000263" class="method-signature">
          <span class="method-name">raise_unexpected_message_args_error</span><span class="method-args">(expectation, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000263-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000263-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 19</span>
19:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_unexpected_message_args_error</span>(<span class="ruby-identifier">expectation</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
20:         <span class="ruby-identifier">expected_args</span> = <span class="ruby-identifier">format_args</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">expectation</span>.<span class="ruby-identifier">expected_args</span>)
21:         <span class="ruby-identifier">actual_args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-value str">&quot;(no args)&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">format_args</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
22:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} expected #{expectation.sym.inspect} with #{expected_args} but received it with #{actual_args}&quot;</span>
23:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000262" class="method-detail">
        <a name="M000262"></a>

        <div class="method-heading">
          <a href="#M000262" class="method-signature">
          <span class="method-name">raise_unexpected_message_error</span><span class="method-args">(sym, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000262-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000262-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 15</span>
15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_unexpected_message_error</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
16:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} received unexpected message :#{sym}#{arg_message(*args)}&quot;</span>
17:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000268" class="method-detail">
        <a name="M000268"></a>

        <div class="method-heading">
          <a href="#M000268" class="method-signature">
          <span class="method-name">raise_wrong_arity_error</span><span class="method-args">(args_to_yield, arity)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000268-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000268-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/error_generator.rb, line 41</span>
41:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_wrong_arity_error</span>(<span class="ruby-identifier">args_to_yield</span>, <span class="ruby-identifier">arity</span>)
42:         <span class="ruby-identifier">__raise</span> <span class="ruby-node">&quot;#{intro} yielded |#{arg_list(*args_to_yield)}| to block with arity of #{arity}&quot;</span>
43:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>